package com.explorati.LeetCode242.isAnagram;

import java.util.Arrays;

/**
 * @ Author : Weijian_Wang
 * @ Date : Created in 22:57 2020/10/27 0027
 * @ Description ：
 */
public class Solution1 {
    public boolean isAnagram(String s, String t) {
        if(s.length() != t.length()) {
            return false;
        }

        char[] s1 = s.toCharArray();
        char[] s2 = t.toCharArray();

        Arrays.sort(s1);
        Arrays.sort(s2);

        return Arrays.equals(s1, s2);

    }
}
